<?php
declare (strict_types=1);

namespace app\command;

use Swoole\Process;
use Swoole\Timer;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\Output;
use think\facade\Console;

class SystemTask extends Command
{
    protected function configure()
    {
        $this->setName('systemTask')
            ->addArgument('option', Argument::OPTIONAL)
            ->setDescription('Start System Task');
    }

    protected function execute(Input $input, Output $output)
    {
        while (true) {
            \Co\run(function () {
                go(function () {
//                    Console::call('');
                });
            });
            $output->write(date('Y-m-d H:i:s') . PHP_EOL);
            sleep(5);
        }
    }
}
